<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text" id="byId" placeholder="请输入英雄id" />
    <button>根据id删除英雄</button>
    <script src="../js/jquery-1.12.4.min.js"></script>
    <script>
        $(function () {
            $.ajax({
                url: 'http://127.0.0.1:3001/getHeroList',
                type: 'GET',
                success: res => {
                    console.log(res);
                }
            })
            $('button').click(function () {
                const id = $('#byId').val();
                $.ajax({
                    url: 'http://127.0.0.1:3001/delHeroById',
                    type: 'GET',
                    data: {
                        id
                    },
                    success: res => {
                        console.log(res);
                    }
                })
            })
        })
    </script>
</body>

</html>